import { Alert } from 'react-native';
import axios from '../../util/http';

export const userFocus = async beFocusUser => {
    try {
        const res = await axios.post('/userFocus/focus', {
            beFocusUser,
        });
        return res.data;
    } catch (e) {
        Alert.alert('请求失败', e.message);
        return null;
    }
};
export const userUnfocus = async beFocusUser => {
    try {
        const res = await axios.post('/userFocus/unfocus', {
            beFocusUser,
        });
        return res.data;
    } catch (e) {
        Alert.alert('请求失败', e.message);
        return null;
    }
};

export const getFocusList = async where => {
    try {
        const res = await axios.post('/userFocus/list', { where });
        return res.data;
    } catch (e) {
        Alert.alert('请求失败', e.message);
        return null;
    }
};
